#ifndef CELEMENTPROTOTYPE_H
#define CELEMENTPROTOTYPE_H

#include <C3dValue.h>
#include <string.h>

namespace NApiCfd
{
    class CElementPrototype
    {
    public:
        CElementPrototype() :
            m_particleID(-1), m_surfacesTotal(0),
            m_mass(0.0), m_volume(0.0)
        {
            m_particleName[0] = '\0';
        }

        CElementPrototype(const CElementPrototype& element)
        {
            *this = element;
        }

        CElementPrototype& operator=(const CElementPrototype& rhs)
        {
            m_particleID = rhs.m_particleID;
            m_surfacesTotal = rhs.m_surfacesTotal;
            m_mass = rhs.m_mass;
            m_volume = rhs.m_volume;
            m_MoI = rhs.m_MoI;

            setParticleName(rhs.m_particleName);
            
            return *this;
        }

        ~CElementPrototype() { }

        int getParticleID() const { return m_particleID; }
        void setParticleID(int id) { m_particleID = id; }

        int getSurfacesTotal() const { return m_surfacesTotal; }
        void setSurfacesTotal(int surfaces) { m_surfacesTotal = surfaces; }

        double getMass() const { return m_mass; }
        void setMass(double mass) { m_mass = mass; }

        double getVolume() const { return m_volume; }
        void setVolume(double volume) { m_volume = volume; }

        const C3dValue& getMomentOfInertia() const { return m_MoI; }
        void setMomentOfInertia(const C3dValue& MoI) { m_MoI = MoI; }

        const char* getParticleName() const { return m_particleName; }
        void setParticleName(const char* type)
        {
            strncpy(m_particleName, type, MAX_TYPENAME_SZ - 1);
            m_particleName[MAX_TYPENAME_SZ - 1] = 0;
        }

    protected:
        const static int MAX_TYPENAME_SZ = 64; /**< Maximum name for surface type */

        int m_particleID;
        int m_surfacesTotal;
        double m_mass;
        double m_volume;
        C3dValue m_MoI;

        char m_particleName[MAX_TYPENAME_SZ];
    };
}


#endif